#include "BinaryTreeMinDepth.hpp"
#include "gtest/gtest.h"
#include "leetcode.h"

namespace
{
TEST( BinaryTreeMinDepth, example1 )
{
    /* [3,9,20,null,null,15,7] */
    TreeNode node_3{ TreeNode( 3 ) };
    TreeNode node_9{ TreeNode( 9 ) };
    TreeNode node_20{ TreeNode( 20 ) };
    TreeNode node_15{ TreeNode( 15 ) };
    TreeNode node_7{ TreeNode( 7 ) };

    node_3.left   = &node_9;
    node_3.right  = &node_20;
    node_20.left  = &node_15;
    node_20.right = &node_7;

    uint32_t expected = 2;
    uint32_t got      = BinaryTreeMinDepth( &node_3 );

    ASSERT_EQ( expected, got );
}
}  // namespace